-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[cfg_match] Adjust syntax #133720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cfg_match] Adjust syntax #133720
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use |
@rustbot modify labels: +T-libs-api -T-compiler |
This comment has been minimized.
This comment has been minimized.
d3bc54d
to
7087e0d
Compare
This comment has been minimized.
This comment has been minimized.
7087e0d
to
bf503ec
Compare
This comment has been minimized.
This comment has been minimized.
bf503ec
to
093de3c
Compare
This comment has been minimized.
This comment has been minimized.
093de3c
to
7dedd32
Compare
This comment has been minimized.
This comment has been minimized.
7dedd32
to
6a107c8
Compare
This comment has been minimized.
This comment has been minimized.
6a107c8
to
5c363b1
Compare
r? libs-api |
5c363b1
to
c635f0d
Compare
r? libs-api |
This looks great. Let's ship it. |
} | ||
|
||
#[cfg(not(bootstrap))] | ||
cfg_match! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't duplicate such large amounts of complicated code next time, it causes headaches when someone is trying to change it (which happened here). Instead it would have been nicer if you had reverted this back to use cfg_if
or just plain cfg until the bootstrap compiler had the new cfg_match
syntax.
A year has passed since the creation of #115585 and the feature, as expected, is not moving forward. Let's change that.
This PR proposes changing the arm's syntax from
cfg(SOME_CONDITION) => { ... }
toSOME_CODITION => {}
.Why? Because after several manual migrations in #116342 it became clear, at least for me, that
cfg
prefixes are unnecessary, verbose and redundant.Again, everything is just a proposal to move things forward. If the shown syntax isn't ideal, feel free to close this PR or suggest other alternatives.